﻿<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="_3rd_Wk___PhonesDB._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Welcome to My Phone Site
    </h2>
    <br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataKeyNames="ID" DataSourceID="PhonesDB" AllowSorting="True">
    <Columns>
        <asp:BoundField DataField="Brand" HeaderText="Brand" SortExpression="Brand" />
        <asp:BoundField DataField="Year-Make" HeaderText="Year-Make" 
            SortExpression="Year-Make" />
        <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
        <asp:ImageField DataImageUrlField="Image" HeaderText="Image">
            <FooterStyle Height="800px" Width="800px" />
        </asp:ImageField>
        <asp:HyperLinkField DataNavigateUrlFields="GSM_URL" 
            DataNavigateUrlFormatString="{0}" DataTextField="Model Name/Number" 
            HeaderText="More Info" />
        <asp:HyperLinkField DataNavigateUrlFields="PostCode" 
            DataNavigateUrlFormatString="http://maps.google.co.uk/?q={0}" 
            DataTextField="PostCode" HeaderText="Location" />
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="PhonesDB" runat="server" 
    ConnectionString="<%$ ConnectionStrings:PhoneConn %>" 
    ProviderName="<%$ ConnectionStrings:PhoneConn.ProviderName %>" 
    SelectCommand="SELECT * FROM [Phones]"></asp:SqlDataSource>
</asp:Content>
